/** @jsxImportSource @emotion/react */
import * as React from "react";
import {Text, useTheme,} from "customize-easy-ui-component";
import { ReportViewProps, } from "../../common/base";
import {末尾链接, 落款单位地址,} from "../../common/rarelyVary";
import {结论报告概况,} from "./repView";
import {useRepMenuDirItems} from "../../hook/useMainRepUrlOr";
import {AppendixPageVw} from "./AppendixPage";
import {注意事项MVS, 目录页VS,} from "../../movable/rarelyVary";
import {ReportFirstPageHeadNmaNmbbm} from "../../contain/rarelyVary";
import {Projects默认} from "./orcBase";
import {首页设备概况Oxygen} from "./rarelyVary";
import {结论报告盖章} from "./Conclusion";

export const ReportView: React.FunctionComponent<ReportViewProps> = ({
    repId,   source: orc,  verId,rep,
}) => {
    const theme= useTheme();
    // const [mapFxian]=useItemsMapPressure({ projects:orc.Projects });
    const [rootMenu]=useRepMenuDirItems(Projects默认, orc.Projects, `/reportView/${rep?.modeltype}/ver/${verId}/${repId}`);

  return (
    <React.Fragment>
        {rootMenu}
        <div css={{"@media not print": {marginTop: '1rem', marginBottom: '1rem'}}}>
            <div css={{
                display: 'flex',
                flexDirection: 'column',
                justifyContent: 'space-between',
                "@media print": {height: '100vh', pageBreakInside: 'avoid',}
            }}>
                {ReportFirstPageHeadNmaNmbbm({theme, rep })}
                <div>
                    <Text variant="h3" css={{textAlign: 'center', "@media (min-width:690px),print and (min-width:538px)": {fontSize: theme.fontSizes[6],}}}>
                      氧舱委托年度检查报告
                    </Text>
                    <br css={{"@media not print": {display: 'none'}}}/>
                    <Text variant="h5" css={{textAlign: 'center',}}> （ FJB/RC 10372-2022 ）</Text>
                </div>
                <div>
                   {首页设备概况Oxygen({theme, orc, rep})}
                </div>
                <div css={{textAlign: 'center', "@media print": {pageBreakInside: 'avoid'}}}>
                    {落款单位地址}
                </div>
            </div>
            {注意事项MVS({
                rep,
                comply: '书为依据《氧舱安全技术监察规程》制定，适用于氧舱委托年度检查报告的结论报告，检验结论仅代表该设备在检验时的安全状况'
            })}

            {结论报告概况({theme, orc, rep})}
            {结论报告盖章({theme, orc, rep})}

            <AppendixPageVw  orc={orc} rep={rep}/>
        </div>
        {末尾链接({template: rep?.modeltype, verId, repId: repId || ''})}
    </React.Fragment>
  );
}
